﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QuTouTiaoAssist.Util;

namespace QuTouTiaoAssist
{
    public partial class FrmModifyPwd : FrmOkCancelBase
    {
        public FrmModifyPwd()
        {
            InitializeComponent();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!CheckLogin())
                return;

            try
            {
                var result = QttHelper.ModifyPwd(base.MemeberToken, this.textBox1.Text, this.textBox2.Text);
                if (result.Code != 0)
                {
                    MsgBox.ShowInfo("修改失败，" + result.Message);
                    return;
                }

                this.Hide();
                MsgBox.ShowInfo("修改成功！");
                this.DialogResult = DialogResult.OK;
            }
            catch (Exception ex)
            {
                MsgBox.ShowInfo("修改失败，" + ex.Message);
            }
        }
    }
}
